document.addEventListener('plusready',function(){
	var member_id = plus.storage.getItem('id'); 
	var ws = plus.webview.currentWebview();
	var user = ws.user;  
	console.log(user);
	//   注册验证
	$('.res_pasw').on('click',function(){
		var password = $('.password').val();
		var password1 = $('.password1').val();
		if(!password || !password1){
			toast('密码不能为空');
			return;
		}
		if(password.length != 6 || password1.length != 6){
			toast('密码长度为6的支付密码！'); 
			return;
		}
//		console.log(dt['tel']+'--'+dt['id']);
//		console.log(apiRoot + "?m=Home&c=Member&a=register1"+'&user='+dt['tel']+'&pass='+pass1+"&id="+dt['id']);
		$.ajax({  
			type:"post",   
			url: apiRoot + "?act=member_account&op=modify_paypwd_step5",
			data:{member_id:member_id,password:password,password1:password1},
			dataType: 'json', 
			success:function(data){
				console.log(JSON.stringify(data));  
				if(data.code == 200){
					toast('修改支付密码成功');
					var nwaiting = plus.nativeUI.showWaiting();//显示原生等待框
					var webviewContent= plus.webview.create('./Personal.html','Personal.html');//后台创建webview并打开show.html
					webviewContent.addEventListener("loaded", function() { //注册新webview的载入完成事件
					        nwaiting.close(); //新webview的载入完毕后关闭等待框
							ws.close();
					        webviewContent.show("slide-in-right",500); //把新webview窗体显示出来，显示动画效果为速度200毫秒的右侧移入动画
			        }, false);
				}else{
					toast(data.datas.error);
				}
			},
			error:function(e){
			 	console.log(JSON.stringify(e));
			 	plus.nativeUI.toast('失去连接');
			 }
		});
	})
},false);